# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Gmail.V1.Model.VacationSettings do
  @moduledoc """
  Vacation auto-reply settings for an account. These settings correspond to the "Vacation responder" feature in the web interface.

  ## Attributes

  *   `enableAutoReply` (*type:* `boolean()`, *default:* `nil`) - Flag that controls whether Gmail automatically replies to messages.
  *   `endTime` (*type:* `String.t`, *default:* `nil`) - An optional end time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives before the end time. If both `startTime` and `endTime` are specified, `startTime` must precede `endTime`.
  *   `responseBodyHtml` (*type:* `String.t`, *default:* `nil`) - Response body in HTML format. Gmail will sanitize the HTML before storing it. If both `response_body_plain_text` and `response_body_html` are specified, `response_body_html` will be used.
  *   `responseBodyPlainText` (*type:* `String.t`, *default:* `nil`) - Response body in plain text format. If both `response_body_plain_text` and `response_body_html` are specified, `response_body_html` will be used.
  *   `responseSubject` (*type:* `String.t`, *default:* `nil`) - Optional text to prepend to the subject line in vacation responses. In order to enable auto-replies, either the response subject or the response body must be nonempty.
  *   `restrictToContacts` (*type:* `boolean()`, *default:* `nil`) - Flag that determines whether responses are sent to recipients who are not in the user's list of contacts.
  *   `restrictToDomain` (*type:* `boolean()`, *default:* `nil`) - Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for Google Workspace users.
  *   `startTime` (*type:* `String.t`, *default:* `nil`) - An optional start time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives after the start time. If both `startTime` and `endTime` are specified, `startTime` must precede `endTime`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :enableAutoReply => boolean() | nil,
          :endTime => String.t() | nil,
          :responseBodyHtml => String.t() | nil,
          :responseBodyPlainText => String.t() | nil,
          :responseSubject => String.t() | nil,
          :restrictToContacts => boolean() | nil,
          :restrictToDomain => boolean() | nil,
          :startTime => String.t() | nil
        }

  field(:enableAutoReply)
  field(:endTime)
  field(:responseBodyHtml)
  field(:responseBodyPlainText)
  field(:responseSubject)
  field(:restrictToContacts)
  field(:restrictToDomain)
  field(:startTime)
end

defimpl Poison.Decoder, for: GoogleApi.Gmail.V1.Model.VacationSettings do
  def decode(value, options) do
    GoogleApi.Gmail.V1.Model.VacationSettings.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Gmail.V1.Model.VacationSettings do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
